import React, { Component } from "react";

export default class PropsCom extends Component {
  //构造方法
  constructor(props){
    // console.log(props);
    super(props);
  }

  render() {
    //输出 props 属性
    // console.log(this.props);
    //解构数据
    let {name, age, gender} = this.props;
    return (
      <div>
        <ul>
          <li>姓名:{name}</li>
          <li>年龄:{age}</li>
          <li>性别:{gender}</li>
        </ul>
        <hr style={{margin: '20px 0'}} />
      </div>
    );
  }
}
